<?php
 /*
 * @Author: KingMin 
 * @Date: 2021-07-13 22:29:47 
 * @Last Modified by:   KingMin 
 * @Last Modified time: 2021-07-13 22:29:47 
 * @The authors website: https://www.kingmin.cn  
 */
    /**
     * 全局项加载
    **/

    error_reporting(E_ALL); //报告所有错误
    ob_start(); //打开缓冲区
    header('Content-Type: text/html; charset=UTF-8');

    
    define('KINGMIN_ROOT', str_replace('\\','/',dirname(__FILE__)));

    define('PASH_ROOT', substr(str_replace('\\','/',dirname(__FILE__)),0,stripos(str_replace('\\','/',dirname(__FILE__)),'/include')));
    // 引入
    require_once KINGMIN_ROOT.'/lib/function.base.php';
    require_once KINGMIN_ROOT.'/lib/envclass.php';
    require_once KINGMIN_ROOT. '/sdk/qiniuSdk/src/Qiniu/functions.php';
    
    if (extension_loaded('mbstring')) {
        mb_internal_encoding('UTF-8');
    } 
    ENV::loadFile(PASH_ROOT.'/.version');
    define('KM_VERSION',ENV::get('version'));
    ENV::loadFile(PASH_ROOT.'/.env');
    // echo ENV::get('database.hostname');
    
    //mysql database address
    define('DB_HOST',ENV::get('database.hostname'));
    //mysql database user
    define('DB_USER',ENV::get('database.username'));
    //database password
    define('DB_PASSWD',ENV::get('database.password'));
    //database nameDATABASE
    define('DB_NAME',ENV::get('database.database'));
    //database prefix PREFIX
    define('DB_PREFIX',ENV::get('database.prefix'));
    define('DB_CHARSET',ENV::get('database.charset'));
    define('DB_HOSTPORT',ENV::get('database.hostport'));
    define('DEFAULT_TIMEZONE',ENV::get('app.default_timezone'));
    define('DEFAULT_LANG',ENV::get('lang.default_lang'));
    
    // REDIS
    define('REDIS_HOSTNAME',ENV::get('redis.redis_hostname'));
    define('REDIS_PORT',ENV::get('redis.port'));
    define('REDIS_PASSWORD',ENV::get('redis.redis_password'));
    
    
    date_default_timezone_set(DEFAULT_TIMEZONE); //设置时区
    
    // define('AUTH_COOKIE_NAME','EM_AUTHCOOKIE_IymPJZdAuQ3ofspUK7Y40zytihVNDjPT');
    
    




    doStripslashes();


    $CACHE = Cache::getInstance();

    define('KINGMIN_URL', Option::get('siteUrl'));
    
    //模板库地址
    const TPLS_URL = PASH_ROOT . '/templates/';
    //模板库路径
    const TPLS_PATH = PASH_ROOT . '/templates/';



